from django.urls import re_path
from .views import channel, article

urlpatterns = [
    # """头条模块路由"""
    # # 路由注释
    # re_path('^$', views.View.as_view()),
    # 频道
    re_path('^channels/$', channel.ChannelsView.as_view()),
    # 文章列表
    re_path('^headline/(?P<id>.+)/channel/$', article.ArticleListView.as_view()),
    # 收藏与取消收藏
    re_path('^headline/(?P<id>.+)/collect/$', article.ArticleCollectView.as_view()),
    # 发表评论
    re_path('^headline/(?P<id>\d+)/publish_comment/$', article.ArticleCommentView.as_view()),
    # 文章详情
    re_path('^headline/(?P<pk>\d+)/$', article.ArticleDetailView.as_view()),
    # 发布文章
    re_path('^headline/$', article.ArticleEditorView.as_view()),

    re_path('^article/(?P<pk>\d+)/$', article.ArticleDetailView.as_view()),
    # # 搜索文章
    re_path('^articles/search/$', article.ArticleSearchView.as_view()),

]
